﻿@model authinfo_dto
@{
    ViewBag.Title = "实名认证";
    Layout = "~/Views/Shared/_MallLayout.cshtml";
}
<body class="page-name page-nameInfor">
    <form id="form1">
        <input type="hidden" id="card_img" name="card_img" value="@Model.card_img"/>
        <div class="lt-block">
            <div class="headImg">
                <img src="~/Content/css/tokenmall/img/sm1.jpg" alt="">
            </div>
            <div class="mod-forms-one">
                <div class="item">
                    <div class="tit fn26">证件类型</div>
                    <div class="inputBox">
                        <input class="ui-input" id="choice" data-type="1" type="text" placeholder="@(Model.certificate_type == 2 ? "护照号" : (Model.certificate_type == 3 ? "港澳台往来通行证" : "身份证"))">
                        <i class="icon-btarrow"></i>
                    </div>
                </div>
                <div class="item">
                    <div class="tit fn26">姓名</div>
                    <div class="inputBox">
                        <input class="ui-input input-require" type="text" id="user_name" name="user_name" value="@Model.account_name" placeholder="请输入您的真实姓名">
                    </div>
                </div>
                <div>
                    <div class="item j-item cur">
                        <div class="tit fn26">身份证</div>
                        <div class="inputBox">
                            <input class="ui-input input-require" type="text" id="card_no" name="card_no" value="@Model.id_card" placeholder="请输入您的身份证号">
                        </div>
                    </div>
                </div>
                <div class="tip fn26 col-red" style="display:none">
                    <i class="icon-tip"></i> 身份证号格式不正确
                </div>
            </div>
            <div class="btnBox">
                <a href="javascript:submitAuthenticationBase();" class="ui-btn-buy">提 交</a>
            </div>
        </div>
        <div class="lt-pop">
            <div class="mask"></div>
            <div class="panel trans_3">
                <ul>
                    <li class="@(Model.certificate_type == 1 ? "cur" : "")" data-type="1">
                        身份证<i class="icon-gou fn-right"></i>
                    </li>
                    <li class="@(Model.certificate_type == 2 ? "cur" : "")" data-type="2">
                        护照号<i class="icon-gou fn-right"></i>
                    </li>
                    <li class="@(Model.certificate_type == 3 ? "cur" : "")" data-type="3">
                        港澳台往来通行证<i class="icon-gou fn-right"></i>
                    </li>
                </ul>
            </div>
        </div>
    </form>
</body>
@section scripts{
    <script>
        $(function () {
            // 选择证件类型 弹窗
            $("#choice").click(function () {
                $('.lt-pop').addClass('cur');
                $('.panel').addClass('show');
            });
            $(".mask").click(function () {
                setTimeout("$('.lt-pop').removeClass('cur');", 300);
                $('.panel').removeClass('show');
            });

            // 选择证件类型
            $('.lt-pop li').click(function () {
                $(this).addClass('cur').siblings('li').removeClass('cur');
                var type = $(this).attr('data-type');
                var txt = $(this).text().trim();
                $("#choice").attr("data-type", type);
                $("#choice").attr("placeholder", txt);
                $('.j-item .fn26').text(txt);
                $(".j-item .ui-input").attr("placeholder", "请输入您的" + txt);
                $(".mask").click();
            })
        })
    </script>

    <script type="text/javascript">
    function submitAuthenticationBase() {
        var flag = true;
        $("#form1 .input-require").each(function (index, el) {
                if ($(el).val() == undefined || $(el).val() == '') {
                    flag = false;
                    layer.msg($(el).attr('placeholder'));
                    return false;
                }
            });
        if (!flag)
            return flag;
        window.location.href = '@Url.Action("AuthenticationPerfect", "Task")?' + $("#form1").serialize() + '&type=' + $("#choice").attr('data-type');
    }

    </script>
}